<?php

require_once '../funcoes.php';
require_once '../config.php';
require_once 'login.class.php';

$login = $_POST['login'];
$senha = $_POST['senha'];
//funcoes::debuga($_POST, URL_ADMIN);
$cLogin = new Login("tb_login");
$logar = $cLogin->logar($login, $senha, URL_ADMIN . "principal.php");

if ($logar) {
    header("location:" . URL_ADMIN . "index.php?msg=1");
} else {
    header("location:" . URL_ADMIN . "principal.php");
}

